import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/views/Home.vue'

export default createRouter({
    history: createWebHistory(),

    routes: [
        {
            path: '/',
            name: 'Home',
            redirect: '/home',
            children: [
                {
                    path: 'home',
                    component: HomeView,
                    children: [
                        {
                            path: 'sql',  // 修正为相对路径
                            component: () => import('@/views/DatabasePage.vue')
                        },
                        {
                            path: 'analysis',  // 修正为相对路径
                            component: () => import('@/views/AIDialogue.vue')
                        },
                        {
                            path:'sql-parser',
                            component: () => import('@/views/sql/SqlParser.vue')
                        },
                        {
                            path:'sql-know',
                            component: () => import('@/views/sql/SqlKnowledge.vue')
                        },
                        {
                            path:'sql-creat',
                            component: () => import('@/views/sql/SqlCreat.vue')
                        },
                    ]
                }
            ]
        },
    ]


})
